<script setup lang="ts">

interface Props {
    /** 标题栏的中文标题 */
    title?: string;
    /** 标题栏的英文标题 */
    englishTitle?: string;
    /** 标题颜色是否为红色 */
    isGoods?: boolean;
}

defineOptions({
    name: 'ContentTitle'
})

withDefaults(defineProps<Props>(), {
    title: '标题',
    englishTitle: '',
    isGoods: false
})

</script>

<template>
    <div class="content-title" :class="{ isGoods }">
        <div class="title">{{ title }}</div>
        <div class="english-title">{{ englishTitle.toUpperCase() }}</div>
    </div>
</template>

<style lang="less" scoped>
div.isGoods {
    .english-title {
        color: var(--primary-color);
    }

    .title {
        color: var(--primary-color);
    }
}

.content-title {
    display: flex;
    align-items: center;

    &::before {
        content: '';
        display: block;
        width: 4px;
        height: 20px;
        background-color: var(--primary-color);
        margin-right: 10px;
    }

    .english-title {
        color: rgba(140, 142, 143, 1);
        font-size: 14px;
        margin-left: 20px;
        line-height: 1em;
        margin-top: 3px;
    }

    .title {
        color: rgba(140, 142, 143, 1);
        font-size: 20px;
        line-height: 1em;
        font-weight: 700;
    }
}
</style>
